package org.obs.abs;
import java.util.Random;

import org.hibernate.Session;
import org.obs.core.hibernate.operations.CreateUserOperation;
import org.obs.domain.User;
import org.obs.form.CreateUserForm;


public class FixtureUtils {

	public static User createRandomUser(Session session) {
		CreateUserForm form = new CreateUserForm();
		Random random = new Random(10000);
		form.setEmail("test"+ random.nextLong() +"@mail.ru");
		form.setPassword("password");
		form.setNick("nick"+ random.nextLong());
		return (User) new CreateUserOperation(form).execute(session);
	}
}
